

#include<iostream> 
#include<string>
#include<fstream>
#include<string.h>

class Util
{public:
     static std::string getOneLine(std::string &buffer,const std::string &sep)
     { auto pos=buffer.find(sep);
        if(pos==std::string::npos) return " ";
        std::string line=buffer.substr(0,pos);
        return line;
     }
     static bool readFile(const std::string path, std::string *buffer,int size)
     {
        std::ifstream in(path,std::ios::binary);//读文件，path为文件所在路径
        if(!in.is_open()) 
         {
        std::cerr << "[Error] File not found: " << path << std::endl; // 输出详细错误
        return false;}
        std::string line;
        while(std::getline(in,line))
        { 
          *buffer+=line;
        }
     // in.read(buffer,size);
      in.close();
      return true;
     }



};